// 插件入口文件
import Vue from 'vue'
//弹出查找树
import tree from './TreeDialog';

const TreeDialog = {};
TreeDialog.install = function (options, ref) {


    if (options === undefined || options === null || options === '') {
        options = {
            title: '未获取标题',
            ref: 'no ref'
        }
    } else {
        options = {
            title: options,
            ref: ref
        }
    }
    
    let TreeBox = Vue.extend(tree);
    let TreeEl = new TreeBox({
        data: options
    }).$mount().$el;
    document.body.appendChild(TreeEl);
    Vue.nextTick(() => {
        TreeEl.visible = true
    })



    // this.$refs[ref].value = this.$store.getters.TreeType


    //1.传type到 store
    //2.打开tree组件
    //3.tree组件获取type值 , 渲染响应treeDate ,选中Data传store
    //4.读取store treedate渲染到form上
}
export default TreeDialog;